def assert_common(res, exp1, exp2, exp3, exp4):
    assert res.status_code == exp1
    assert res.json()["success"] == exp2
    assert res.json()["code"] == exp3
    assert exp4 in res.json()["message"]


def assert_add(res, exp1, exp2, exp3, exp4, exp5):
    assert res.status_code == exp1
    assert res.json()["success"] == exp2
    assert res.json()["code"] == exp3
    assert exp4 in res.json()["message"]
    # 当接收到的departmentId的预期值exp5 不为 None的时候，才进行断言
    if exp5 is not None:
        assert res.json()["data"]["departmentId"] == exp5


def assert_query(res, exp1, exp2, exp3, exp4, exp5):
    assert res.status_code == exp1
    assert res.json()["success"] == exp2
    assert res.json()["code"] == exp3
    assert exp4 in res.json()["message"]
    # 当接收到的id的预期值exp5 不为 None的时候，才进行断言
    if exp5 is not None:
        assert res.json()["data"]["id"] == exp5
















